let s:self = { 'options': #{
				\ line: 3,
				\ col: 80,
				\ minwidth: 120,
				\ time: 3000,
				\ tabpage: -1,
				\ zindex: 300,
				\ drag: 1,
				\ highlight: 'String',
				\ border: [],
				\ close: 'click',
				\ padding: [0,1,0,1],
				\ }}

function! s:self.print(text, ...) dict
    if a:0 > 0
        let options = a:1
        call extend(options, self.options, "keep")
    else
        let options = deepcopy(self.options)
    endif
    call popup_notification(a:text, options)
endfunction 

function! s:self.debug(text, ...) dict
    let options = {'highlight': 'Debug', 'line': self.options.line  }
    if a:0 > 0
        call extend(options, a:1, "keep")
    endif
    return self.print(a:text, options)
endfunction 

function! s:self.info(text, ...) dict
    let options = {'highlight': 'String', 'line': self.options.line + 4}
    if a:0 > 0
        call extend(options, a:1, "keep")
    endif
    return self.print(a:text, options)
endfunction 

function! s:self.warn(text, ...) dict
    let options = {'highlight': 'WarningMsg', 'line': self.options.line + 8}
    if a:0 > 0
        call extend(options, a:1, "keep")
    endif
    return self.print(a:text, options)
endfunction 

function! s:self.error(text, ...) dict
    let options = {'highlight': 'ErrorMsg', 'line': self.options.line + 12}
    if a:0 > 0
        call extend(options, a:1, "keep")
    endif
    return self.print(a:text, options)
endfunction 

function! api#message#get() abort
    return deepcopy(s:self)
endfunction 
